//
//  ShowFormat.h
//  Stock_Pro
//
//  Created by imuse on 10-11-29.
//  Copyright 2010 gaotime. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ShowFormat : NSObject

#define PriceLSumShow(a) a==0?@"0":[NSString stringWithFormat:@"%d", a]
#define PriceMSumShow(a) abs(a)>=10000?[NSString stringWithFormat:@"%d万", a/10000]:PriceLSumShow(a)
#define PriceSumShow(a) abs(a)>=100000000?[NSString stringWithFormat:@"%d亿", a/100000000]:PriceMSumShow(a)

#define llShow(a) a==0?@"-":[NSString stringWithFormat:@"%lld", a]
#define vsShow(a) abs(a)>=10000?[NSString stringWithFormat:@"%.2f万", a/10000.0]:llShow(a)
#define VolSumShow(a) abs(a)>=100000000?[NSString stringWithFormat:@"%.2f亿", a/100000000.0]:vsShow(a)

#define llShowL2(a) a==0?@"0":[NSString stringWithFormat:@"%.2f", a]
#define vsShowL2(a) abs(a)>=10000?[NSString stringWithFormat:@"%.2f万", a/10000.0]:llShowL2(a)
#define VolSumShowL2(a) abs(a)>=100000000?[NSString stringWithFormat:@"%.2f亿", a/100000000.0]:vsShowL2(a)


#define PriShow(a) a==0?@"-":[NSString stringWithFormat:@"%.2f", a]
#define PriShowE(a,b) a==0?@"-":PriShow((a-b))
#define DifShowE(a,b)[NSString stringWithFormat:@"%.2f%%", (a+0.0)/b*100]
#define DifShow(a,b) a==0?@"-":a==b?@"0.00%":DifShowE(a,b)

#define DifRange(a) a==0?@"-":[NSString stringWithFormat:@"%.2f%%", (a+0.0)/100]
#define DifRange2(a) a==0?@"0.00%":[NSString stringWithFormat:@"%.2f%%", (a+0.0)/100]

#define DRShowF(a)[NSString stringWithFormat:@"%.2f%%", (a+0.0)/100]

#define DVShowE(a,b)[NSString stringWithFormat:@"%.2f", (a-b)]
#define DVShow(a,b) a==0?@"-":a==b?@"0.00":DVShowE(a,b)

#define DRShowE(a,b)[NSString stringWithFormat:@"%.2f%%", (a-b)*100.0/b]
#define DRShow(a,b) a==0||b==0?@"-":a==b?@"0.00%":DRShowE(a,b)

#define SwpShow(a) a==0?@"-":[NSString stringWithFormat:@"%.2f%%", (a+0.0)/100]

#define SwpShow2(a) a==0?@"-":[NSString stringWithFormat:@"%.2f%%", (a+0.0)*100]

#define EPShow(a) a==0?@"-":[NSString stringWithFormat:@"%.2f", (a+0.0)/10000]

//add by jason

//end


#define D_PriShow(a,d) a==0?@"-":(d==3?[NSString stringWithFormat:@"%.3f", a]:[NSString stringWithFormat:@"%.2f", a])
#define D_PriShowE(a,b,d) a==0?@"0.00":D_PriShow((a-b),d)

#define D_PriShow2(a,d) a==0?@"0.00":(d==3?[NSString stringWithFormat:@"%.3f", a]:[NSString stringWithFormat:@"%.2f", a])

//#define DREShow(f) f==0?@"-":[NSString stringWithFormat:@"%.2f%%", f]

@end
